package com.xuhuan.demo.pattern.factory.absfactory.pizzastore.order;

import com.xuhuan.demo.pattern.factory.absfactory.pizzastore.pizza.LDCheesePizza;
import com.xuhuan.demo.pattern.factory.absfactory.pizzastore.pizza.Pizza;

/**
 * @author huan.xu
 * @date 2021/10/4 16:32
 * @description
 */
public class LDFactory implements AbsFactory {
    /**
     * 创建披萨
     *
     * @param orderType
     * @return
     */
    @Override
    public Pizza createPizza(String orderType) {
        System.out.println("使用抽象工厂模式");
        Pizza pizza = null;
        if ("cheese".equals(orderType)) {
            pizza = new LDCheesePizza();
        } else if ("pepper".equals(orderType)) {
            pizza = new LDCheesePizza();
        }
        return pizza;
    }
}
